#ifndef _TIMER_H
#define _TIMER_H
// Macro to pretify the use of Timer (it's used all over the place, remember)
#define TIMER() util::Timer::Instance()
#include <string>

namespace util
{

class Timer
{
public:
    static Timer  & Instance();
    void            Reset();            // Reset the timers
    void            Tick();             // New frame


    float   		Delta() const	{	return m_DeltaTime; };          // Time since last frame.
    float    		Time() const	 {	return m_CurrentTime; };         // Time since start.
	int				GetFrameID() const	{ return m_FrameID; };
	float			FPS() const		{	return m_FPS; };									// frames per second
	bool			NewFPS() const	{	return (m_FrameCounter== 0);};		

// does the actual heavy lifting of tracking time
	static float	GetTimeStamp();

private:
                    Timer();            // Can only be instantiated by
                    ~Timer();           //   Timer::Create();

	float			m_DeltaTime;
	float			m_SecondsCounter;
	int				m_FrameCounter;
	int				m_FrameID;
	float			m_CurrentTime;
	float			m_FPS;
	float			m_LastTime;
	unsigned int	m_MinPeriod;

};

}   // End of namespace util

#endif // #ifndef _TIMER_H
